package sq.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import sq.dao.Food;
import java.util.List;

/**
 * @author sunquan
 * 2018/2/24
 * @description
 */
@Repository
public interface FoodMapper {
    @Select("select * from food")
     List<Food> findAll();
    @Select("select * from food where food_type=#{foodType}")
    List<Food> findFoodByType(Integer foodType);
    @Select("select * from food where food_name like #{foodName}")
    List<Food> findFoodByName(String foodName);
    @Select("select * from food where food_name like #{foodName}  and food_type=#{foodType}")
    List<Food> findFoodByNameAndType(@Param("foodName") String foodName, @Param("foodType")Integer foodType);
}
